#version 330 core

layout(points) in;
layout(triangle_strip, max_vertices = 4) out;

void main()
{
      

        gl_Position = gl_in[0].gl_Position + vec4(-20,20,0.,0.);
        EmitVertex ();                
        gl_Position = gl_in[0].gl_Position + vec4(20,20,0.,0.);
        EmitVertex ();
        gl_Position = gl_in[0].gl_Position + vec4(-20,-20,0.,0.);
        EmitVertex ();        
        gl_Position = gl_in[0].gl_Position + vec4(20,-20,0.,0.);
        EmitVertex ();


       /* float l = .05;
       
        vec4 A = gl_in[0].gl_Position / gl_in[0].gl_Position.w;
        vec4 B = gl_in[1].gl_Position / gl_in[1].gl_Position.w;
        vec4 C = gl_in[2].gl_Position / gl_in[2].gl_Position.w;
        
        vec4 mAB = (A + B)*.5;
        vec2 AB = B.xy - A.xy;
        vec4 mABdir = vec4( normalize( vec2(AB.y, -AB.x) ), 0.,0.) * l;

        gl_Position = mAB + mABdir; EmitVertex ();
        gl_Position = mAB - mABdir; EmitVertex ();
     
        vec4 O = (A + 6.* B + C)*.175;        
        vec2 AC = C.xy - A.xy;
        vec4 Odir = vec4( normalize( vec2(AC.y, -AC.x) ), 0.,0.) * l;
      
        gl_Position = O + mABdir; EmitVertex ();
        gl_Position = O - mABdir; EmitVertex ();

        vec4 mBC = (B + C)*.5;
        vec2 BC = C.xy - B.xy;
        vec4 mBCdir = vec4( normalize( vec2(BC.y, -BC.x) ), 0.,0.) * l;

        gl_Position = mBC + mBCdir; EmitVertex ();
        gl_Position = mBC - mBCdir; EmitVertex ();*/
        
}

